package info.techgeek.labs.gregorianCalendar;

import java.util.Date;
import java.util.GregorianCalendar;

public class CalculateDays {

	public static void main(String[] args) {
		
		GregorianCalendar gc = new GregorianCalendar();
		
		int count = 0;
		
		gc.clear();
		gc.setTime(new Date());
//		gc.add(GregorianCalendar.YEAR , -1);
		
//		gc.set(GregorianCalendar.HOUR, gc);
//		gc.add(GregorianCalendar.DAY_OF_MONTH, +7);
		
//		System.out.println(GregorianCalendar.DAY_OF_MONTH);
//		System.out.println(GregorianCalendar.DAY_OF_WEEK);
		System.out.println("Current Date "+new Date() + " - "+gc.getTime() );
		
//		System.out.println("DAY_OF_WEEK "+gc.get(gc.DAY_OF_WEEK));
//		System.out.println("DAY_OF_WEEK_IN_MONTH "+gc.get(gc.DAY_OF_WEEK_IN_MONTH));
//		System.out.println("MONTH "+gc.get(gc.MONTH));
//		System.out.println("DAY_OF_MONTH "+gc.get(gc.DAY_OF_MONTH));
//		System.out.println("HOUR "+gc.get(gc.HOUR));
//		System.out.println("HOUR "+gc.get(gc.HOUR_OF_DAY));
//		System.out.println("MINUTE "+gc.get(gc.MINUTE));

		System.out.println("count "+count );
		gc.add(GregorianCalendar.MONTH, -2);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, -1);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 0);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 1);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 2);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 3);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 4);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 5);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 6);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 7);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 8);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		gc.add(GregorianCalendar.MONTH, 9);
		count = count + gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
		System.out.println("count "+count +" Month Count "+gc.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
		gc.clear();
		gc.setTime(new Date());
		
		
		System.out.println("DAY OF YEAR "+gc.get(GregorianCalendar.DAY_OF_YEAR ));
		System.out.println("DAY OF YEAR "+gc.getActualMaximum(GregorianCalendar.DAY_OF_YEAR) );
		System.out.println("DAY OF YEAR "+gc.getMaximum(GregorianCalendar.DAY_OF_YEAR) );
	}
	
}
